package com.xof.phonecall.model

import com.xof.phonecall.valipetrpide.ValPopWindowType

data class RevPopWindowConfig(
    val code: String,
    val msg: String,
    val obj: List<RevObjPopWindowConfig>
) {

    data class RevObjPopWindowConfig(
        /** 弹窗模式 */
        val mode: String,
        /** 条件 */
        val condition: String? = "",
        /** 优先级 */
        val level: Long? = 0L,
        /** 图标 */
        val icon: String? = "",
        /** id */
        val id: String,
        /** 展示页面 */
        val page: String,
        /** 弹窗标题 */
        val title: String? = "",
        /** 弹窗内容 */
        val content: String? = "",
        /** 弹窗生效日期 */
        val startDate: String? = "",
        /** 弹窗失效日期 */
        val endDate: String? = ""
    ) {
        fun isHomePop(): Boolean {
            return page.equals(ValPopWindowType.HOME.name, true)
        }

        fun isApplyPop(): Boolean {
            return page.equals(ValPopWindowType.APPLY.name, true)
        }

        fun isReviewPop(): Boolean {
            return page.equals(ValPopWindowType.REVIEW.name, true)
        }

        fun isLoaningPop(): Boolean {
            return page.equals(ValPopWindowType.LOANING.name, true)
        }

        fun isRepayPop(): Boolean {
            return page.equals(ValPopWindowType.REPAY.name, true)
        }
    }
}
